package fr.ants.view.renderer.pixel;

import java.awt.Color;
import java.awt.Graphics2D;

import fr.ants.model.Resource;
import fr.ants.view.panel.Canvas;
import fr.ants.view.renderer.ResourceRenderer;

/**
 * <p>Renders a resource with pixels.</p> 
 *
 * @author Vianney DUPOY DE GUITARD
 */
public class ResourcePixelRenderer implements ResourceRenderer {

	/** {@inheritDoc} */
	public void draw(int x, int y, Graphics2D g, Resource res) {
		g.setColor(new Color(125, 195, 240));
		g.fillOval(
				x * Canvas.NODE_SIZE + Canvas.NODE_SIZE / 4,
				y * Canvas.NODE_SIZE + Canvas.NODE_SIZE / 2,
				Canvas.NODE_SIZE / 2,
				(int) (Canvas.NODE_SIZE * 0.8)
		);
	}
}